def binarySearch(numbers, number):
    left = 0
    right = len(numbers) - 1
    comparisons = 0

    while left <= right:
        mid = (left + right) // 2
        mid_value = numbers[mid]
        comparisons += 1

        if mid_value == number:
            return comparisons
        elif mid_value < number:
            left = mid + 1
        else:
            right = mid - 1

    return comparisons

# === DO NOT modify the code below ===
def main():
    a = [ eval(x) for x in input().split() ]
    n = eval(input())
    print(binarySearch(a,n))
    
if __name__ == '__main__':
    main()
# === DO NOT modify the code above ===